package demo.spring.framework.scheduling.concurrent;

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

public class ThreadPoolTaskExecutorDemo {

    public static void main(String[] args) {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        // 核心线程数
        executor.setCorePoolSize(1);
        // 最大线程数
        executor.setMaxPoolSize(3);
        // 队列最大长度
        executor.setQueueCapacity(100);
        // 线程池维护线程所允许的空闲时间，默认为60s
        executor.setKeepAliveSeconds(60);
    }
}
